package test;

import java.util.List;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;
import org.testng.annotations.Test;

public class AddUser extends base.TestBase
{
	WebElement userNameField;
	WebElement passwordField;
	
	@Test
	public void testUntitled () throws Exception
	{    
		driver.get(baseUrl + "/php4dvd/");
		
		userNameField = driver.findElement(By.id("username"));
		userNameField.clear();
		userNameField.sendKeys("admin");
		
		passwordField = driver.findElement(By.name("password"));
		passwordField.clear();
		passwordField.sendKeys("admin");
		
		driver.findElement(By.name("submit")).click();
		
		driver.findElement(By.xpath(".//*[@id='wrapper']/header/div/nav/ul/li[3]/a")).click();
		
		driver.findElement(By.id("username")).clear();
		driver.findElement(By.id("username")).sendKeys("Andrey");
		
		driver.findElement(By.name("email")).clear();
		driver.findElement(By.name("email")).sendKeys("klmmkl@mail.ru");
		
		driver.findElement(By.name("password")).clear();
		driver.findElement(By.name("password")).sendKeys("123");
		
		driver.findElement(By.name("password2")).clear();
		driver.findElement(By.name("password2")).sendKeys("123");
		
		driver.findElement(By.xpath(".//*[@id='form']/table/tbody/tr[5]/td[2]/select/option[2]")).click();
		
		driver.findElement(By.name("submit")).submit();

	}
}